package T4;
//在测试类Demo中分别创建Rectangle对象、Circle对象、Sphere对象、Cylinder对象，
//调用它们的toString()方法。测试结果如下：
public class Demo {
    public static void main(String[] args) {
        Rectangle rectangle = new Rectangle(2.4,5.6);
        System.out.println(rectangle);
        Circle circle = new Circle(3.0);
        System.out.println(circle);
        Sphere sphere = new Sphere(3.0);
        System.out.println(sphere);
        Cylinder cylinder=new Cylinder(3.0,5.0);
        System.out.println(cylinder);
    }
}
